
export default {
    data: {
        shopTotal$: '',
    },
    reqShopCartTotal () {
        let { api$ } = this.data;
        this.httpRequest(api$.REQ_SHOP_CART_TOTAL, {}, {
            useAuth: true,
            loading: false,
        }).then((res) => {
            let number = +res.total || 0;
            let text = number > 99 ? '...' : number <= 0 ? '' : `${number}`;
            this.setData({ shopTotal$: { text, number } });
            if (this.tabBarBadgeShow) {
                this.tabBarBadgeShow({ index: 2, text }).null();
            }
        }).toast();
    }
}
